package Io;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        File file=new File("test.txt");
        FileOutputStream fos=new FileOutputStream(file);
        Scanner scan=new Scanner(System.in);
        while (true){
            String use=scan.next();
            if ("exit".equals(use)){

                System.out.println("finish");
                break;
            }else {
                byte[] str=use.getBytes(StandardCharsets.UTF_8);
                fos.write(str);

            }
        }
        fos.close();

    }
}
